//
//  UIImage+RNKit.m
//  RNIMKit
//
//  Created by slj on 2017/8/14.
//  Copyright © 2017年 __OrganizationName__. All rights reserved.
//

#import "UIImage+IOAKit.h"

NSString *const commonBundle = @"CommonResource.bundle";
NSString *const imBundle = @"IMResource.bundle";
NSString *const userBundle = @"USERResource.bundle";
NSString *const emotIconBundle = @"RNIMKitEmoticon.bundle";
NSString *const fileIconBundle = @"FileIcon.bundle";
NSString *const constactBundle = @"Constact.bundle";

@implementation UIImage(IOAKit)


+ (UIImage *)ioa_imageNamed_common:(NSString *)name
{
#ifndef IOA_PROJECT
    name = [ [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:commonBundle] stringByAppendingPathComponent:name];
#endif
    return [[self class] imageNamed:name];
}

+ (UIImage *)ioa_imageNamed_im:(NSString *)name
{
#ifndef IOA_PROJECT
    name = [imBundle stringByAppendingString:name];
#endif
    return [[self class] imageNamed:name];

}

+ (UIImage *)ioa_imageNamed_user:(NSString *)name
{
#ifndef IOA_PROJECT
    name = [userBundle stringByAppendingString:name];
#endif
    return [[self class] imageNamed:name];
    
}
+ (UIImage *)ioa_imageNamed_emoticon:(NSString *)name
{
#ifndef IOA_PROJECT
    name = [emotIconBundle stringByAppendingString:name];
#endif
    return [[self class] imageNamed:name];
    
}

+ (UIImage *)ioa_imageNamed_file:(NSString *)name
{
#ifndef IOA_PROJECT
    name = [fileIconBundle stringByAppendingString:name];
#endif
    return [[self class] imageNamed:name];
    
}

+ (UIImage *)ioa_imageNamed_constact:(NSString *)name
{
#ifndef IOA_PROJECT
    name = [constactBundle stringByAppendingString:name];
#endif
    return [[self class] imageNamed:name];
    
}


@end
